import request from '@/router/axios';
import qs from 'qs';

// 根据id查询项目基本信息
export const getDataById = (data) => request({
    url: '/projectList/v1/standingBook',
    method: 'post',
    data: qs.stringify(data),
})
// 获取项目成员
export const getUsersByProjectId = (data) => request({
    url: '/projectMember/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})

// 获取成员组织
export const getDepartmentList = (data) => request({
    url: '/department/v1/selectAllDepartment',
    method: 'post',
    data: qs.stringify(data),
})

// 项目新增成员
export const addProjectAddList = (data) => request({
    url: '/projectMember/v1/batchInsertProjectMember'+data.query,
    method: 'post',
    data: data.data,
})

// 项目新增成员
export const addProjectAddListW = (data) => request({
    url: '/projectMember/v1/batchInsertExternal'+data.query,
    method: 'post',
    data: data.data,
})
// 项目新增成员
export const addProjectAdd = (data) => request({
    url: '/department/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})
// 项目删除成员
export const delProjectUser = (data) => request({
    url: '/projectMember/v1/getById?id='+data,
    method: 'post',
})


/* 员工时工 */
// 获取员工工时
export const getDataByUserId = (data) => request({
    url: '/manHourManagement/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})
// 添加员工工时
export const addUserData = (data) => request({
    url: '/manHourManagement/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})

// 修改员工工时
export const updUserData = (data) => request({
    url: '/manHourManagement/v1/update',
    method: 'post',
    data: qs.stringify(data),
})
// 删除员工工时
export const delUserData = (data) => request({
    url: '/manHourManagement/v1/getById?id='+data,
    method: 'post',
})
// 获取-项目资料
export const getProjectData = (data) => request({
    url: '/projectData/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})


/* 项目资料 */
// 添加-项目资料
export const addProjectData = (data) => request({
    url: '/projectData/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})
// 下载-项目资料
export const downloadProjectData = (data) => request({
    url: '/projectData/v1/auth/getFileNameUrl?getFileNameUrl='+data.getFileNameUrl,
    method: 'get',
})
// 预览-项目资料
export const previewProjectData = (data) => request({
    url: '/projectData/v1/preview?id='+data,
    method: 'post',
})
// 删除-项目资料
export const delProjectData = (data) => request({
    url: '/projectData/v1/getById?id='+data,
    method: 'post',
})

/* 项目物品 */
// 获取-项目物品列表
export const getProjectArticleList = (data) => request({
    url: '/projectArticle/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})
// 获取-项目物品
export const getProjectArticle = (data) => request({
    url: '/projectArticle/v1/findById?id='+data,
    method: 'post',
})
// 添加-项目物品
export const addProjectArticle = (data) => request({
    url: '/projectArticle/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})
// 修改-项目物品
export const updProjectArticle = (data) => request({
    url: '/projectArticle/v1/update',
    method: 'post',
    data: qs.stringify(data),
})
// 删除-项目物品
export const delProjectArticle = (data) => request({
    url: '/projectArticle/v1/getById?id='+data,
    method: 'post',
})

/* 项目设备 */
// 获取-项目设备
export const getProjectEquipment = (data) => request({
    url: '/projectEquipment/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})
// 批量添加-项目设备
export const addProjectEquipmentList = (data) => request({
    url: '/projectEquipment/v1/batchInsertProjectEquipent'+data.query,
    method: 'post',
    data: data.data,
})
// 添加-项目设备
export const addProjectEquipment = (data) => request({
    url: '/projectEquipment/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})
// 修改-项目设备
export const updProjectEquipment = (data) => request({
    url: '/projectEquipment/v1/update',
    method: 'post',
    data: qs.stringify(data),
})
// 删除-项目设备
export const delProjectEquipment = (data) => request({
    url: '/projectEquipment/v1/getById?id='+data,
    method: 'post',
})

/* 项目报告 */
// 获取-项目报告
export const getProjectPresentation = (data) => request({
    url: '/projectReport/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})
// 添加-项目报告
export const addProjectPresentation = (data) => request({
    url: '/projectReport/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})
// 修改-项目报告
export const updProjectPresentation = (data) => request({
    url: '/projectReport/v1/update',
    method: 'post',
    data: qs.stringify(data),
})
// 删除-项目报告
export const delProjectPresentation = (data) => request({
    url: '/projectReport/v1/getById?id='+data,
    method: 'post',
})
// 预览-项目报告
export const previewProjectPresentation = (data) => request({
    url: '/projectReport/v1/preview?id='+data,
    method: 'post',
})
// 仪表盘数据
export const selectSoilNow = (data) => request({
    url: '/dashboardData/v1/selectSoilNow',
    method: 'post',
    data:data,
    params:data
})
// (孢子仪)
export const dashboardDataSelectSporeStatusNow = (data) => request({
    url: '/dashboardData/v1/selectSporeStatusNow',
    method: 'post',
    data:qs.stringify(data),
})
//农田能量系统数据展示
export const dashboardDataSelectFluxNow = (data) => request({
    url: '/dashboardData/v1/selectFluxNow',
    method: 'post',
    data:qs.stringify(data),
})
//气象站
export const dashboardDataSelectStationMin30Now = (data) => request({
    url: '/dashboardData/v1/selectStationMin30Now',
    method: 'post',
    data:qs.stringify(data),
})

//干湿沉降仪
export const dashboardDataSelectRainNow = (data) => request({
    url: '/dashboardData/v1/selectRainNow',
    method: 'post',
    data:qs.stringify(data),
})

//测报灯
export const dashboardDataSelectLampStatusNow = (data) => request({
    url: '/dashboardData/v1/selectLampStatusNow',
    method: 'post',
    data:qs.stringify(data),
})

//温室气体
export const dashboardDataSelectHouseNow = (data) => request({
    url: '/dashboardData/v1/selectHouseNow',
    method: 'post',
    data:qs.stringify(data),
})

//温室气体
export const dashboardDataSelectCo2Now = (data) => request({
    url: '/dashboardData/v1/selectCo2Now',
    method: 'post',
    data:qs.stringify(data),
})

//(杀虫灯)
export const dashboardDataSelectInsecticidalNow = (data) => request({
    url: '/dashboardData/v1/selectInsecticidalNow',
    method: 'post',
    data:qs.stringify(data),
})

//智能插座数据展示)根据设备id查询
export const dashboardDataSelectElectricNow = (data) => request({
    url: '/dashboardData/v1/selectElectricNow',
    method: 'post',
    data:qs.stringify(data),
})

//根据主键查询
export const equipmentFindById = (data) => request({
    url: '/equipment/v1/findById',
    method: 'post',
    data:qs.stringify(data),
})

//根据智能操作id查询改数据
export const equipmentFindEquipmentseLectEl = (data) => request({
    url: '/equipment/v1/findEquipmentseLectEl',
    method: 'post',
    data:qs.stringify(data),
})